import com.xingxuecn.demos.service.impl.GoodsService;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Kris at 2018/9/25 17:30
 */
public class App {
    public static void main(String[] args) throws InterruptedException {
        ApplicationContext context = new ClassPathXmlApplicationContext("Beans.xml");
        /*UserServiceImpl userService = context.getBean(UserServiceImpl.class);
        userService.sayHello();


        MenuService menuService = context.getBean(MenuService.class);
        menuService.sayHello();
        System.out.println(menuService.toString());*/


        /*RoleService roleService = context.getBean(RoleService.class);
        System.out.println(roleService.toString());
*/
        /*RoleService roleService1 = context.getBean("roleService1",RoleService.class);
        System.out.println(roleService1.toString());*/

        GoodsService goodsService = context.getBean("goodsService",GoodsService.class);
        System.out.println(goodsService.toString());

        SimpleDateFormat sdf = context.getBean(SimpleDateFormat.class);
        System.out.println(sdf.format(new Date()));
    }
}
